package com.zhong.gang.app.ui.message;

import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.zhong.gang.app.R;
import com.zhong.gang.applib.utils.TimeUtils;

public class MessageAdapter extends BaseQuickAdapter<MessageBean, BaseViewHolder> {

    public MessageAdapter() {
        super(R.layout.item_message);
    }

    @Override
    protected void convert(BaseViewHolder helper, MessageBean item) {
        helper.setText(R.id.title,item.getTitle());
        helper.setText(R.id.content,item.getContent());
        helper.setText(R.id.time, item.getUpdateTime());
        ((TextView)helper.getView(R.id.title)).setTextColor(mContext.getResources().getColor(item.isReaded()?R.color.gray6:R.color.gray3));
        ((TextView)helper.getView(R.id.content)).setTextColor(mContext.getResources().getColor(item.isReaded()?R.color.gray6:R.color.gray3));
        ((TextView)helper.getView(R.id.time)).setTextColor(mContext.getResources().getColor(item.isReaded()?R.color.gray9:R.color.gray6));
    }
}
